import { Sequelize, DataTypes } from "sequelize";

export = function (DB: Sequelize, Types: DataTypes): any {
    const attributes = {
        id: {
            type: Types.BIGINT,
            primaryKey: true,
            autoIncrement: true,
        },
        username: {
            type: Types.STRING(50),
            allowNull: false,
        },
        pwd: {
            type: Types.STRING(50),
            allowNull: false,
        }
    };
    const options = {
        tableName: 'users',
        timestamps: true,
        underscore: true,
    };
    return DB.define('User', attributes, options);
}